package day03;
import java.util.Scanner;
public class Cashier {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		System.out.println("请输入单价");
		int price = scan.nextInt();
		System.out.println("请输入数量");
		int num = scan.nextInt();
		System.out.println("请输入金额");
		int money = scan.nextInt();
		double count = price * num;
		if((double)money >= count){
			if(count >= 500){
				count = count * 0.8;
				System.out.println("应收金额为:"+count+",找零:"+(money - count));
			}else{
				System.out.println("应收金额为:"+count+",找零:"+(money - count));
			}
		}else{
			System.out.println("error");
		}
		scan.close();
	}

}
